<?php
/**
 * Created by PhpStorm.
 * User: toshiba
 * Date: 2015/4/17
 * Time: 14:47
 */

class goods extends Activity{

    //商品历史价格
    function getAllPriceTask($gopen_id){
        $r['data']=GoodsMode::init()->getAllPrice($gopen_id);
        $r['resultCode']= !empty($r['data']) ? 200:500;
        View::displayAsJson($r);
    }

    function getGoodsShareUsersTask($gopen_id,$from_id,$num=20){
    	//单次显示数量
        list($r['data']['list'],$r['data']['total'])=GoodsMode::init()->goodsShareUsers($from_id,$gopen_id,$num);
    	//打个码  
    	foreach ($r['data']['list'] as $key => &$value) {
    		//var_dump(str_split($value['username']));
    		$arr = str_split($value['username']);
    		for($i=3;$i<7;$i++){
    			$arr[$i] = "*";
    		}
    		$value['username'] = implode($arr);
    	}
    	$r['resultCode']= !empty($r['data']) ? 200:500;
    	View::displayAsJson($r);
    }
} 